<% score = @score || Score.find_by_judge_id_and_round_id_and_contestant_id(judge.id, round.id, contestant.id) -%>
<% domid = "p#{pageant.id}r#{round.id}c#{contestant.id}j#{judge.id}" -%>
<div id='<%=domid%>'>
  <% if score == nil -%>
    <% score = Score.new %>
    <% score.pageant = pageant %>
    <% score.contestant = contestant -%>
    <% score.judge = judge -%>
    <% score.round = round -%>
    <% score.locked = false -%>
  <% end -%>
  <% if not score.locked -%>
    <% form_tag '/', :method=>:post, :id=>"form_#{domid}" do %>
      <%= hidden_field_tag :pageant_id, score.pageant_id %>
      <%= hidden_field_tag :contestant_id, score.contestant_id %>
      <%= hidden_field_tag :judge_id, score.judge_id %>
      <%= hidden_field_tag :round_id, score.round_id %>
      <%= text_field_tag :value, score.value, :size=>6 , :id=>"fld_#{domid}" %>
    <% end -%>
    <%= observe_form("form_#{domid}", :frequency=>1, :url=>{:controller => :scores, :action => :add_score})%>
  <% else -%>
    <%=h number_with_precision(score.value, 2) %> 
  <% end -%>
</div>